package com.gem.day06.extend1;

import java.time.LocalDate;

/**没有底薪的销售员工*/
public class SalsEmployee extends Employee {
	private double total;//销售额
	private double rank;//提成率

	public SalsEmployee() {

	}

	public SalsEmployee(String name, LocalDate birthday, double total, double rank) {
		//super表示调用父类中对应的构造方法
		//注意:必须写在第一行
		super(name, birthday);
		this.total = total;
		this.rank = rank;
	}

	public double getTotal() {
		return total;
	}

	public void setTotal(double total) {
		this.total = total;
	}

	public double getRank() {
		return rank;
	}

	public void setRank(double rank) {
		this.rank = rank;
	}

	@Override
	public double getSalary(int month) {
		return super.getSalary(month) + total * rank;
	}

	@Override
	public String toString() {
		return super.toString() + ",销售额: " + total + ", 提成率: " + rank;
	}
}
